﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package ZLocalization.Substituters {

    public class SubstituterFr extends SubstituterContractions {

        protected static const VOWEL:String = "vowel";
        protected static const CONSONANT:String = "consonant";

        protected static var vowels:Object = {
            a:1,
            à:1,
            á:1,
            â:1,
            ä:1,
            e:1,
            è:1,
            é:1,
            ê:1,
            ë:1,
            i:1,
            ì:1,
            í:1,
            î:1,
            ï:1,
            o:1,
            ò:1,
            ó:1,
            ô:1,
            ö:1,
            u:1,
            ù:1,
            ú:1,
            û:1,
            ü:1
        };
        protected static var contractionMap:Object = {
            le:{
                de:"du",
                à:"au"
            },
            les:{
                de:"des",
                à:"aux"
            },
            un:{de:"d'un"},
            une:{de:"d'une"},
            des:{de:{
                    vowel:"d'",
                    consonant:"de"
                }}
        };

        override protected function getContractionMap():Object{
            return (SubstituterFr.contractionMap);
        }
        override protected function getContraction(_arg1:Object, _arg2:String):String{
            if (typeof(_arg1) == "string"){
                return (String(_arg1));
            };
            var _local3:Array = _arg2.match(new RegExp("\\S"));
            var _local4:String = _local3[0];
            if (SubstituterFr.vowels.hasOwnProperty(_local4)){
                return (_arg1[SubstituterFr.VOWEL]);
            };
            return (_arg1[SubstituterFr.CONSONANT]);
        }

    }
}//package ZLocalization.Substituters 
